<template>
    <div id="player">
        <audio src="" ref="audio" id="mp3Btn"></audio>
    </div>
</template>
<script>
import axios from "axios";
export default {
    methods:{
        getSong(){
            var that = this;
            var id = this.$store.state.msg;
            /*
            问题：
            码云上是https，mixed content...，把请求http改成https
            vue.config.js文件
            module.export =
            {
                
                baseUrl:"./"(加上去)
            }
            */
            this.axios.get("music/url?timestamp=1503",{
                params:{
                    id:id 
                }
            }).then(function(res){
                that.$refs.audio.src = res.data.data[0].url;
                that.$refs.audio.play();
            });

        }
    }
}
    document.addEventListener("WeixinJSBridgeReady", function () { 
        document.getElementById('mp3Btn').play(); 
        // document.getElementById('video').play(); 
    }, false);
</script>

<style>
    
</style>